<?php
/*
Copyright 2011 Erick Martínez Sámano

This file is part of PHP Quick Calendar E.

This view is heavely influenced by the original PHP Quick Calendar's Standard View
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
$doc=& JFactory::getDocument(); $doc->addStyleSheet($this->baseurl.DS.'components'.DS.'com_pqce'.DS.'css'.DS.'standard.css');
?>
<div class="article-content" id='standardQCE'>
<div id="isQCE">
<table class="standard" cellspacing="0" border="0" cellpadding="0">
<thead>
<tr>
<th style="border-left:1px solid #000000">&nbsp;<a href="<?php echo $this->href['prevYear']; ?>" title="<?php echo JText::_('COM_PQCE_PREVY'); ?>">&laquo;</a></th>
<th>&nbsp;<a href="<?php echo $this->href['prevMonth']; ?>"  title="<?php echo JText::_('COM_PQCE_PREVM'); ?>"><</a></th>
<th colspan='3' style="font-size:14pt"><?php echo $this->href['header']; ?></th>
<th><a href="<?php echo $this->href['nextMonth']; ?>" class='headerNav' title="<?php echo JText::_('COM_PQCE_NEXTM'); ?>">></a>&nbsp;</th>
<th style="border-right:1px solid #000000">&nbsp;<a href="<?php echo $this->href['nextYear']; ?>" class='headerNav' title="<?php echo JText::_('COM_PQCE_NEXTY'); ?>">&raquo;</a></th>
</tr>
</thead>

<tbody>
<tr><th style="border-left:1px solid #000000"><?php echo JText::_('COM_PQCE_3D01'); ?></th><th><?php echo JText::_('COM_PQCE_3D02'); ?></th><th><?php echo JText::_('COM_PQCE_3D03'); ?></th><th><?php echo JText::_('COM_PQCE_3D04'); ?></th><th><?php echo JText::_('COM_PQCE_3D05'); ?></th><th><?php echo JText::_('COM_PQCE_3D06'); ?></th><th style="border-right:1px solid #000000"><?php echo JText::_('COM_PQCE_3D07'); ?></th></tr>
<?php
for($i=0; $i<$this->weeksInMonth; $i++) {
	// display the row
	echo '<tr>';
	// display the column
	for ($j=0; $j < 7; $j++) {
		// design each cell
		if ($this->cell[$i][$j]['link'] != 'none' && !($this->cell[$i][$j]['isToday'])) {
			$class = 'withLink';
		}
		elseif ($this->cell[$i][$j]['isToday']) {
			$class = 'today';
		}
		else {
			$class = 'withoutLink';
		}

		echo "<td class='$class'>";
		
		$dia=$this->cell[$i][$j]['day']; $v=$this->cell[$i][$j]['short_desc'][0];
		if ($v){
			echo '<span class="spanQCE">'.$dia.'</span><a class="aQCE" href="'.JRoute::_("index.php?option=com_pqce&f=$dia.$this->month.$this->year").'">'.JText::_('COM_PQCE_SHOWALL').'</a><br />';
			echo "<div class='cellLink'>";
		}else{
			echo '<span class="spanQCE">'.$dia.'</span><br />';
		}
		foreach ($this->cell[$i][$j]['short_desc'] as $k => $v) {
			if ($this->cell[$i][$j]['short_desc'][$k]) {
				echo '<div class="li">';
				if ($this->cell[$i][$j]['short_desc_images'][$k]) {
					echo "{$this->cell[$i][$j]['short_desc_images'][$k]}".'<br />';
				}
				echo '<span class="spnQCELhr">'.$this->cell[$i][$j]['hora'][$k].'</span><br />'.$this->cell[$i][$j]['short_desc'][$k].'</div>';
			}
		}
		if ($v){echo "</div>";}
		echo '</td>';
	}
	
	// end row
	echo '</tr>';
}
?>
</tbody>
</table></div>
<?php if ($this->type) echo '<div id="sDescQCE">'. $this->loadTemplate($this->type). '</div>'; ?>
</div>
